﻿using FruitVentDesignDemo.Enums;
using System.Globalization;
using System;
using System.Windows.Data;
using FruitVentDesignDemo.Extensions;

namespace FruitVentDesignDemo.Converters
{
    [ValueConversion(typeof(SexEnum), typeof(string))]
    public class SexEnumToDisplayTextConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return value is SexEnum sex ?  sex.GetDescription() : "";
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
